package by.koleda.photoupdater.manager;

import java.util.List;

import android.content.Context;
import by.koleda.photoupdater.content.VkProfileList;
import by.koleda.photoupdater.helpers.ParamCallback;
import by.koleda.photoupdater.helpers.VkOAuthHelper;
import by.koleda.photoupdater.model.VkProfile;

public class ContentManager {
	
	private static ContentManager instance;
	
	public static final String FRIENDS_INFO_URL = "https://api.vk.com/method/friends.get?fields=uid,first_name,last_name,nickname,bdate(birthdate),city,contacts,photo,photo_medium,photo_big";
	
	private ContentManager() {
		
	}
	
	public static ContentManager getInstance() {
		if (instance == null) {
			instance = new ContentManager();
		}
		return instance;
	}
	
	public void getContent(Context context, final ParamCallback<List<VkProfile>> paramCallback) {
		new VkProfileList(paramCallback).start(VkOAuthHelper.sign(context, FRIENDS_INFO_URL));
	}
	
	public void getSingleUser(Context context, String uid, final ParamCallback<List<VkProfile>> paramCallback) {
		String userInfoUrl = "https://api.vk.com/method/users.get?uid=" + uid + "&fields=uid,first_name,last_name,nickname,bdate(birthdate),city,contacts,photo,photo_medium,photo_big";
		new VkProfileList(paramCallback).start(VkOAuthHelper.sign(context, userInfoUrl));
	}
}
